<?php

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
$sessionLifeTime=1800;

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Dating Site',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
        'ext.eoauth.*',
        'ext.eoauth.lib.*',
        'ext.lightopenid.*',
        'ext.eauth.services.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
        'user',
        'admin',
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'test',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('192.168.1.1','::1'),
		),
	),

	// application components
	'components'=>array(
		'user'=>array(
            'loginUrl'=>array('user/auth/login'),
            'class'=>'WebUser',
            // enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
        // Bootsrap
        'bootstrap'=>array(
            'class'=>'bootstrap.components.Bootstrap',
        ),
        'mail'=>array(
            'class'=>'ext.yii-mail.YiiMail',
            'transportType'=>'smtp',
            'transportOptions'=>array(
                'host'=>'ssl://smtp.ukr.net',
                'username'=>'rem_kwadriga@ukr.net',
                'password'=>'itkrjghzl1984',
                'port'=>'465',
                //'encryption'=>'ssl',
            ),
            'viewPath' => 'application.views.mail',
        ),
        'request'=>array(
            'enableCsrfValidation'=>true,
        ),
        'snauth'=>array(
            'class'=>'ext.snauth.SNAuth',
            'service'=>'testService',
            'services'=>array(
                'facebook'=>array(
                    'class'=>'ext.snauth.services.FacebookService',
                    'clientId'=>'560379094019677',
                    'clientSecret'=>'52a41fd2b14b0e1b0e47d7fc29c6a0d6',
                ),
                'vkontakte'=>array(
                    'class'=>'ext.snauth.services.VKontakteService',
                    'clientId'=>'3792862',
                    'clientSecret'=>'z9KyiKOxxOjHzDBVMVht',
                ),
               'mailru'=>array(
                    'class'=>'ext.snauth.services.MailruService',
                    'clientId'=>'708227',
                    'clientSecret'=>'c89f12607174f62a5e6d88afc08613c9',
                ),
                /*'google'=>array(
                    'class'=>'ext.snauth.services.GoogleService',
                    'clientId'=>'431607418311.apps.googleusercontent.com',
                    'clientSecret'=>'aMmC6FAP3av9ZurKoVYbZP7s',
                ),*/
                'twitter'=>array(
                    'class'=>'ext.snauth.services.TwitterService',
                    'clientId'=>'RVq6CIaUfArt7GcBfmfmUg',
                    'clientSecret'=>'7sc81HeD6HoKCk8lnygrNaBT9aSvaE6n7mLoYRxw8',
                ),
                'yandex'=>array(
                    'class'=>'ext.snauth.services.YandexService',
                    'clientId'=>'537f56fcc00a47a0a2cf52c8fb41baa4',
                    'clientSecret'=>'016e2c2bfc8941e79d9ad7c095417e6c',
                ),
                'odnoklassniki'=>array(
                    'class'=>'ext.snauth.services.OdnoklassnikiService',
                    'clientId'=>'192473344',
                    'clientPublic'=>'CBAKOJHMABABABABA',
                    'clientSecret'=>'E52429EBEA2AFDE9B8FBF9D0',
                ),
            ),
        ),
        'post'=>array(
            'class'=>'ext.postHandler.PostHandler',
        ),
        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),

		'db'=>array(
			'connectionString'=>'mysql:host=192.168.0.200;dbname=datingSite',
			'emulatePrepare'=>true,
			'username'=>'datingSite',
			'password'=>'datingSite',
			'charset'=>'utf8',
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),

        'authManager'=>array(
            'class'=>'DSAuthManager',
            'defaultRoles'=>array('guest'),
        ),

        'session'=>array(
            'class'=>'system.web.CHttpSession',
            'sessionName'=>'SID',
            'timeout'=>$sessionLifeTime,
            'cookieParams'=>array (
                'lifetime'=>31536000,
                'path'=>'/',
                'httponly'=>'on',
            ),
        ),
    ),

    'sourceLanguage'=>'en_US',
    'language'=>'ru',
    'charset'=>'utf-8',

	'params'=>array(
		'adminEmail'=>'rem_kwadriga@ukr.net',
        'salt'=>'tmdR_erE@iuk.comE-F5.5qK_55g?5gj7Op.li2-dfl:I7dsfd_p9',
        'sessionLifeTime'=>$sessionLifeTime,
        'adminElementsPerPage'=>5,
	),
);